/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.kaetec.services;

import br.com.kaetec.dao.ClienteDAO;
import br.com.kaetec.dao.ContatoDAO;
import br.com.kaetec.entities.Cliente;
import java.sql.SQLException;
/**
 *
 * @author Sergio Artero
 */
public class ContatoService {
    
    private ContatoDAO dao;
    
    public ContatoService(){
        dao = new ContatoDAO();
    }
    
    public boolean salvar(Cliente cliente) {
		
        boolean isTransactionOk = false;
        
        isTransactionOk = dao.mantemContato(cliente);
        
        return isTransactionOk;
		
    }
    
    public void excluir(Cliente cliente) throws SQLException{
        if (cliente.getId() <= 0) throw new SQLException("Cliente não armazenado no banco de dados!");
        
        dao.exclui(cliente);
        
    }
    
}
